package com.emergency.assist.domain;

import com.emergency.base.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * 路线的节点数据类
 */
@Entity
@Table(name = "bus_route_point")
public class RoutePoint extends BaseEntity {

    //路线名
    private String name;
    //起点
    private String startLocation;
    //终点
    private String endLocation;
    //距离 单位：米
    private Double distance;
    //路线途经点，文本大类型
    @Lob
    private String path;
    //排序
    private long sort;

    /**
     * 路线
     */
    @JsonIgnore
    @OneToOne(targetEntity = Route.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "route_id", referencedColumnName = "id")
    private Route route;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStartLocation() {
        return startLocation;
    }

    public void setStartLocation(String startLocation) {
        this.startLocation = startLocation;
    }

    public String getEndLocation() {
        return endLocation;
    }

    public void setEndLocation(String endLocation) {
        this.endLocation = endLocation;
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public long getSort() {
        return sort;
    }

    public void setSort(long sort) {
        this.sort = sort;
    }

    public Route getRoute() {
        return route;
    }

    public void setRoute(Route route) {
        this.route = route;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}